package cn.edu.hunan.pm.service;

import cn.edu.hunan.pm.Entity.PatentTransaction;
import cn.edu.hunan.pm.mapper.PatentTransactionMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PatentTransactionService {
    @Autowired
    private PatentTransactionMapper patentTransactionMapper;

    public void addPatentTransaction(PatentTransaction patentTransaction) {
        patentTransactionMapper.insert(patentTransaction);
    }

    public void deletePatentTransactionById(Integer transactionId) {
         patentTransactionMapper.deleteById(transactionId);
    }

    public void updatePatentTransaction(PatentTransaction patentTransaction) {
         patentTransactionMapper.update(patentTransaction);
    }

    public PatentTransaction findPatentTransactionById(Integer transactionId) {
        return patentTransactionMapper.findById(transactionId);
    }

    public List<PatentTransaction> findAllPatentTransactions() {
        return patentTransactionMapper.findAll();
    }
}
